<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>审核管理- <{$columnname}></title>
        <meta name="keywords" content="">
        <meta name="description" content="">
        <link rel="shortcut icon" href="../favicon.ico">
        <link href="__PUBLIC__/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
        <link rel="stylesheet" href="__PUBLIC__/css/ace.min.css"/>
        <link href="__PUBLIC__/css/font-awesome.css?v=4.4.0" rel="stylesheet">
        <link href="__PUBLIC__/css/animate.css" rel="stylesheet">
        <link href="__PUBLIC__/css/style.css?v=4.1.0" rel="stylesheet">
        <script src="__PUBLIC__/js/plugins/layer/laydate/laydate.js"></script>
        <style>
            .table-container {
                overflow: auto;
            }

            .img {
                max-width: 64px;
                max-height: 64px;
            }

            .img2 {
                max-width: 128px;
                max-height: 128px;
            }

            .img-box{ overflow: hidden; text-align: left; }
            .video-box{ overflow: hidden; text-align: left; }
            .video-box .video{ float: left; margin-right: 10px; width: 240px; height: 240px; }
            .video-box .break{ float:left; width: 3px; height: 240px; background: #eee; }
            .video-box .video video{ width: 100% !important; height: 65% !important; border:1px solid #eee; }
            .video-box .video-cover{ float: left; margin-left: 10px; text-align: left; }
            .logo-box{ overflow: hidden; text-align: left; }
        </style>
    </head>
    <body class="gray-bg">
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>审核管理-
                                <small>视频审核列表</small>
                            </h5>
                            <div class="ibox-tools">
                            </div>
                        </div>
                        <div class="ibox-content">
                            <div class="dataTables_filter">
                                <form action="__SELF__" id="form1">
                                    <if condition="$app_code eq ''">
                                        <label>
                                            <select name="ddlapp" id="ddlapp" onchange="form_submit()">
                                                <option value="0">-项目-</option>
                                                <volist name="apparr" id="apparr">
                                                    <option value="<{$apparr.app_flag}>" <if condition="$search.appsel eq $apparr['app_flag']">selected</if>><{$apparr.app_name}></option>
                                                </volist>
                                            </select>
                                        </label>&nbsp;
                                    </if>
                                    <label>
                                        <select name="ddlstate" id="ddlstate" onchange="form_submit()">
                                            <option value="0">-状态-</option>
                                            <volist name="statearr" id="statearr">
                                                <option value ="<{$statearr.value}>" <if condition="$search.statesel eq $statearr['value']">selected</if>><{$statearr.text}></option>
                                            </volist>
                                        </select>
                                    </label>
                                    <label>
                                        <select name="ddlsex" id="ddlsex" onchange="form_submit()">
                                            <option value="0">-性别-</option>
                                            <volist name="sexarr" id="sexarr">
                                                <option value="<{$sexarr.value}>" <if condition="$search.sexsel eq $sexarr['value']">selected</if>><{$sexarr.text}></option>
                                            </volist>
                                        </select>
                                    </label>
                                    <label>
                                        <input type="text" id="txtbegintime" name="txtbegintime" placeholder="请输入开始时间"
                                               readonly="readonly" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm'})"
                                               value="<{$search.begintime}>"/>
                                    </label>
                                    <label>
                                        <input type="text" id="txtendtime" name="txtendtime" placeholder="请输入结束时间"
                                               readonly="readonly" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm'})"
                                               value="<{$search.endtime}>"/>
                                    </label>
                                    <label>
                                        <input type="text" id="txtkeyword" name="txtkeyword" value="<{$search.keyword}>"
                                               placeholder="请输入关键词"/>&nbsp;
                                        <input type="submit" id="btnsearch" name="btnsearch" value="搜索"/>
                                    </label>
                                </form>
                            </div>
                            <table class="table table-striped table-bordered table-hover table-container">
                                <thead>
                                    <tr>
                                        <th width="150px">上传时间</th>
                                        <th>视频封面</th>
                                        <th width="150px">视频</th>
                                        <th width="150px">状态</th>
                                        <th width="150px">审核时间</th>
                                        <th width="150px;">用户头像</th>
                                        <th width="200px;" style="text-align: left;">用户信息</th>
                                        <th width="200px;" style="text-align: left;">操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                <volist name="data" id="vo">
                                    <tr id="<{$vo.id}>">
                                        <td><{$vo.video_ctime}></td>
                                        <td><{$vo.video_img_text}></td>
                                        <td><{$vo.video_info}></td>
                                        <td><{$vo.video_state_text}><if condition="$vo.state eq '3'" ><br />赞：<{$vo.help}></if></td>
                                        <td><{$vo.video_ptime}></td>
                                        <td><{$vo.user_logo_text}></td>
                                        <td style="text-align: left;"><{$vo.user_info}></td>
                                        <td class="operate" style="text-align: left;">
                                            <a class="btn btn-rounded btn-info btn-detail" href="__CONTROLLER__/uservideosidentityadd/videoid/<{$vo.id}>/uid/<{$vo.user_uid}>" title="详情">详情</a>
                                    <if condition="$vo.state elt '2'">
                                        <a class="btn btn-rounded btn-info" href="javascript:void(0);" onclick="check_video('<{$vo.user_uid}>', '1', '<{$vo.id}>')" title="通过">通过</a>
                                        <a class="btn btn-rounded btn-danger" href="javascript:void(0);" onclick="disagree_video_alert('<{$vo.user_uid}>', '2', '<{$vo.id}>')" title="驳回">驳回</a>
                                    </if>
                                    <if condition="$vo.state GT '2'">
                                        <a class="btn btn-rounded btn-danger" href="javascript:void(0);" onclick="delete_video('<{$vo.user_uid}>','', '<{$vo.id}>')" title="删除">删除</a>
                                    </if>
                                    </td>
                                    </tr>
                                </volist>
                                <if condition="($total eq null) or ($total eq 0)">
                                    <tr>
                                        <td colspan="20">没有数据</td>
                                    </tr>
                                </if>
                                </tbody>
                            </table>
                            <div class="dataTables_paginate paging_simple_numbers">
                                <ul class="pagination">
                                    <if condition="$total gt 0">
                                        <{$fpage}>
                                    </if>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="ibox-content disagree-content" style="display: none;">
            <form method="post" class="form-horizontal" onsubmit="return false">
                <div class="form-group">
                    <div class="col-sm-12">
                        <textarea id="txtdisagreeremark" name="txtdisagreeremark" class="form-control" placeholder="请输入驳回理由" style="height:72px;"></textarea>
                    </div>
                </div>
            </form>
        </div>
        <!-- 全局js -->
        <script src="__PUBLIC__/js/jquery.min.js?v=2.1.4"></script>
        <script src="__PUBLIC__/js/bootstrap.min.js?v=3.3.6"></script>
        <!-- 自定义js -->
        <script src="__PUBLIC__/js/content.js?v=1.0.0"></script>
        <script src="__PUBLIC__/js/plugins/layer/layer.min.js"></script>
        <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
        <script>
                var uservideosidentitysubmit = "<{:U('uservideosidentitysubmit','','')}>";
                var uservideosidentitydelete = "<{:U('uservideosidentitydelete','','')}>"
                function check_video(uid, type, videoid) {
                    check(uid, type, videoid);
                }
                function disagree_video_alert(uid, type, videoid) {
                    disagree_alert(uid, type, videoid);
                }
                function check(uid, otype, videoid, remark) {
                    layer.confirm('确定' + (otype == '1' ? '通过' : '驳回') + '该视频吗？', function (index) {
                        layer.close(index);
                        $.post(uservideosidentitysubmit, {'uid': uid, 'otype': otype, 'videoid' : videoid, 'content': remark},
                                function (data) {
                                    if (data.ret == '1001') {
                                        layer.msg(data.code, {icon: 6, time: 1000});
                                        setTimeout(function () {
                                            window.location.reload();
                                        }, 1000);
                                    } else {
                                        layer.msg(data.code, {icon: 5, time: 1500});
                                    }
                                }, 'json');
                    });
                }
                function disagree_alert(uid, otype,  videoid) {
                    var $content = $('.disagree-content');
                    var $txtdisagreeremark = $content.find('#txtdisagreeremark');
                    $txtdisagreeremark.val('');
                    //页面层
                    layer.open({
                        title: '输入驳回理由',
                        type: 1,
                        skin: 'layui-layer-rim', //加上边框
                        btn: ['确定', '取消']
                        , yes: function (index, layero) {
                            var disagreeremark = $txtdisagreeremark.val();
                            if (disagreeremark == "") {
                                layer.alert('请输入驳回理由！\r\n', {title: '提示框', icon: 0});
                                return false;
                            }
                            check(uid, otype, videoid, disagreeremark);
                        }, cancel: function () {
                            //右上角关闭回调
                        },
                        area: ['320px', '228px'], //宽高
                        content: $content
                    });
                }
                function delete_video(uid, otype, videoid) {
                    layer.confirm('确定删除该视频吗？', function (index) {
                        layer.close(index);
                        $.post(uservideosidentitydelete, {'uid': uid, 'otype': otype, 'videoid' : videoid},
                            function (data) {
                                if (data.ret == '1001') {
                                    layer.msg(data.code, {icon: 6, time: 1000});
                                    setTimeout(function () {
                                        window.location.reload();
                                    }, 1000);
                                } else {
                                    layer.msg(data.code, {icon: 5, time: 1500});
                                }
                            }, 'json');
                    });
                }
                function form_submit() {
                    document.getElementById("form1").submit();
                }
        </script>
    </body>
</html>
